//
//  TZYHeaderCell.m
//  Moment
//
//  Created by dllo on 15/12/30.
//  Copyright © 2015年 片刻. All rights reserved.
//

#import "TZYHeaderCell.h"


@implementation TZYHeaderCell




- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    
    
    //20 + 20 + 20 + SCREEN_HEIGHT / 4 / 3 + 20 + SCREEN_HEIGHT / 4 / 2 + 20 + 20 + 10
    
    self.timeL = [[UILabel alloc] init];
    //self.timeL.backgroundColor = [UIColor yellowColor];
    self.timeL.font = [UIFont systemFontOfSize:[TZYFontSize getFontSizeForSmall]];
    
    [self.contentView addSubview:self.timeL];
    
    [self.timeL mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.left.top.mas_equalTo(@20);
        make.width.mas_equalTo(@150);
        make.height.mas_equalTo(@20);
        
    }];
    
    
    self.typeL = [[UILabel alloc] init];
    //self.typeL.backgroundColor = [UIColor yellowColor];
    self.typeL.font = [UIFont systemFontOfSize:[TZYFontSize getFontSizeForSmall]];
    [self.contentView addSubview:self.typeL];
    
    [self.typeL mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.timeL);
        make.left.mas_equalTo(self.timeL.mas_right).offset(20);
        make.right.mas_equalTo(@(-20));
        make.height.mas_equalTo(@20);
        
    }];
//
    self.titleL = [[UILabel alloc] init];
    //self.titleL.backgroundColor = [UIColor yellowColor];
    self.titleL.font = [UIFont systemFontOfSize:[TZYFontSize getFontSizeForBig]];
    self.titleL.numberOfLines = 0;
    [self.contentView addSubview:self.titleL];
    
    [self.titleL mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.typeL.mas_bottom).offset(20);
        make.left.mas_equalTo(@20);
        make.right.mas_equalTo(@(-20));
        make.height.mas_equalTo(@(SCREEN_HEIGHT / 4 / 3));
        
    }];
    
    
    
    
    self.imageB = [[UIImageView alloc] init];
    //self.imageB.backgroundColor = [UIColor purpleColor];
    [self.contentView addSubview:self.imageB];
    
    [self.imageB mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.titleL.mas_bottom).offset(20);
        make.width.mas_equalTo(@(SCREEN_WIDTH / 3));
        make.left.mas_equalTo(@20);
        make.height.mas_equalTo(@(SCREEN_HEIGHT / 4 / 2));
        
    }];
    
    
    self.wenzhangL = [[UILabel alloc] init];
    self.wenzhangL.font = [UIFont systemFontOfSize:[TZYFontSize getFontSizeForMiddle]];
    self.wenzhangL.numberOfLines = 0;
    //self.wenzhangL.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.wenzhangL];
    
    [self.wenzhangL mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.imageB);
        make.left.mas_equalTo(self.imageB.mas_right).offset(10);
        make.right.mas_equalTo(@(-20));
        make.height.mas_equalTo(self.imageB);
        
    }];
    
    
    
    self.commentImageView = [[UIImageView alloc] init];
    //self.commentImageView.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.commentImageView];
    
    self.commentLabel = [[UILabel alloc] init];
    self.commentLabel.font = [UIFont systemFontOfSize:[TZYFontSize getFontSizeForSmall]];
    //self.commentLabel.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.commentLabel];
    
    self.likeImageView = [[UIImageView alloc] init];
    //self.likeImageView.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.likeImageView];
    
    self.likeLabel = [[UILabel alloc] init];
    self.likeLabel.font = [UIFont systemFontOfSize:[TZYFontSize getFontSizeForSmall]];
    //self.likeLabel.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.likeLabel];

    
    
    [self.likeLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(@(-20));
        make.top.mas_equalTo(self.wenzhangL.mas_bottom).offset(20);
        make.height.mas_equalTo(@20);
        make.width.mas_equalTo(@30);
        
    }];
    
    
    
    [self.likeImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(self.likeLabel.mas_left).offset(-2);
        make.top.mas_equalTo(self.likeLabel);
        make.width.height.mas_equalTo(@20);
        
    }];
    self.likeImageView.image = [UIImage imageNamed:@"iconfont-xinxihuan00-2.png"];
    
    

    
    [self.commentLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(self.likeImageView.mas_left).offset(-2);
        make.top.mas_equalTo(self.likeLabel);
        make.height.mas_equalTo(@20);
        make.width.mas_equalTo(@30);
        
    }];
    
    
    [self.commentImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.right.mas_equalTo(self.commentLabel.mas_left).offset(-2);
        make.top.mas_equalTo(self.likeLabel);
        make.height.mas_equalTo(@20);
        make.width.mas_equalTo(@20);
        
    }];
    
    self.commentImageView.image = [UIImage imageNamed:@"iconfont-pinglun.png"];


}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
